//package com._4pd.demo.demo;
//
//import com._4pd.demo.demo.crd.AiOperatorReconciler;
//import io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinition;
//import io.fabric8.kubernetes.client.KubernetesClient;
//import io.fabric8.kubernetes.client.dsl.Resource;
//import io.javaoperatorsdk.operator.Operator;
//
//import java.io.File;
//
//public class OperatorMain {
//    public static void main(String[] args) {
//        Operator operator = new Operator();
//        KubernetesClient client = operator.getKubernetesClient();
//
//        CustomResourceDefinition crd = client.apiextensions().v1()
//                .customResourceDefinitions()
//                .load(new File("target/classes/META-INF/fabric8/crd.demo.ai.operator-v1.yml"))
//                .get();
//        Resource<CustomResourceDefinition> resource = client.apiextensions().v1().customResourceDefinitions().resource(crd);
//        if (resource.isReady()) {
//            System.out.println("crd is ready");
//            resource.delete();
//        } else {
//            System.out.println("crd is not ready,create it!");
//        }
//        resource.create();
//
//
//
//        operator.register(new AiOperatorReconciler(client));
//        operator.start();
//    }
//}
